package com.shf.mapper;

import com.shf.entity.Syslog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 日志持久层
 * @author 叶枫
 */
public interface SyslogMapper {
    /**
     * 保存日志
     * @param syslog
     */
    @Insert("insert into syslog values (#{id},#{visitTime},#{username},#{ip},#{url},#{executionTime},#{method})")
    void saveLog(Syslog syslog);

    /**
     * 展示所有日志
     * @return
     */
    @Select("select * from syslog")
    List<Syslog> findAll();

}
